import { MutableRefObject } from 'react';
import { extendApi } from '@inbiz/utils';
import { ISearchResultMainRef } from './useConfigs';

export default extendApi((_events: MutableRefObject<any>, ref: MutableRefObject<ISearchResultMainRef>) => {
  return Object.keys(ref.current).reduce((pre, next) => {
    pre[next] = (...arg:any) => {
      return ref?.current?.[next]?.(...arg)
    }
    return pre;
  }, {}) as ISearchResultMainRef;
});
